<?php
/**
 * 小邮筒订单
 */
namespace soa\minpost\order\v1\common;

use soa\client;

//运单申请表
class waybillApply  extends client
{
	/**
	 * 服务地址
	 * @var string
	 */
	public $service_url = 'http://mp.kuaidihelp.com/';

	/**
	 * 服务名称
	 * @var string
	 */
	protected $service_name = 'kuaidihelp_mp';

	//添加记录
	public function insert($waybill,$brand,$source_id,$source_type,$apply_time = "",$info = [])
	{
		return $this->post("api/cloudPrint/order/v1/common/waybillApply/insert", compact('waybill',"brand","source_id","source_type","apply_time","info"));
	}

	//根据运单获取
	public function getByWaybill($waybill,$brand){
		return $this->post("api/cloudPrint/order/v1/common/waybillApply/getByWaybill", compact('waybill',"brand"));
	}

	//根据单号源获取
	public function getBySourceId($source_id,$source_type,$extra_info = [],$limit = [],$order_by = "create_time DESC"){
		return $this->post("api/cloudPrint/order/v1/common/waybillApply/getBySourceId", compact("source_id","source_type","extra_info","limit","order_by"));
	}

	//根据用户源获取
	public function getByUser($uid,$platform,$extra_info = [],$limit = [],$order_by = "create_time DESC"){
		return $this->post("api/cloudPrint/order/v1/common/waybillApply/getByUser", compact("uid","platform","extra_info","limit","order_by"));
	}

	//根据用户源获取
	public function getByAgent($agent_guid,$extra_info = [],$limit = [],$order_by = "create_time DESC"){
		return $this->post("api/cloudPrint/order/v1/common/waybillApply/getByAgent", compact("agent_guid","extra_info","limit","order_by"));
	}
}